package org.example.domain.system.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.domain.system.constant.SecurityConstant;

import java.io.Serializable;

/**
 * 用户登录信息
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class LoginUser implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户Id")
    private Long userId;
    @Schema(description = "用户名")
    private String userName;
    @Schema(description = "手机号")
    private String phoneNumber;
    @Schema(description = "用户Token")
    private Long tokenKey;
    private String ip;

    public String getTokenKey(){
        return SecurityConstant.SECURITY_TOKEN_KEY + ":" + this.tokenKey;
    }

}
